﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PropertyAttribute.cs" company="Data Ductus Malmö">
//   (c) 2010 - 2012 Data Ductus Malmö AB
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace DataDuctus.Snmp.Persistor.Core.Attributes
{
  using System;
  using System.ComponentModel;

  /// <summary>
  /// The property attribute.
  /// </summary>
  [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
  public class PropertyAttribute : Attribute
  {
    #region Constructors and Destructors

    /// <summary>
    /// Initializes a new instance of the <see cref="PropertyAttribute"/> class.
    /// </summary>
    public PropertyAttribute()
    {
      this.Access = PropertyAccess.ReadOnly;
    }

    #endregion

    #region Public Properties

    /// <summary>
    /// Gets or sets the property access.
    /// </summary>
    /// <remarks>
    /// Default is <see cref="PropertyAccess.ReadOnly"/>.
    /// </remarks>
    public PropertyAccess Access { get; set; }

    /// <summary>
    /// Gets or sets the description.
    /// </summary>
    public string Description { get; set; }

    /// <summary>
    /// Gets or sets the max length.
    /// </summary>
    public int MaxLength { get; set; }

    /// <summary>
    /// Gets or sets the sub oid.
    /// </summary>
    public int SubOid { get; set; }

    /// <summary>
    /// Gets or sets the source (SNMP) type.
    /// </summary>
    /// <remarks>
    /// If not specified the system will chose a default 
    /// <see cref="TypeConverter"/> based on the 
    /// property <see cref="Type"/>.
    /// </remarks>
    public Type Type { get; set; }

    #endregion
  }
}